/*
Author: Surpass-HC
Source: https://gitee.com/hxchuan000/clpc-1
Mail: surpass-hc@qq.com
*/
#ifndef __C_STRING_COMMAND_DEAL_H__
#define __C_STRING_COMMAND_DEAL_H__
#include <typecomm.h>
typedef int (*cmdcbk)(void *cmdData, void *usrData);
typedef struct
{
    const char *cmdName;
    const char *cmdExplain;
    cmdcbk cmdFun;
} cStrCmdInfStc;
#define CSTR_CMD_INSTANCE_DEF(cfgname, cfgexp, cfgfun) {cfgname, cfgexp, cfgfun}
typedef struct
{
    int cmdNbr;
    cStrCmdInfStc *cmdBuf;
    void *usrData;
} cStrCmdMgrStc;

int cStrCmdMgrInit(cStrCmdMgrStc *scmPtr, cStrCmdInfStc *cfgCmdList, int cfgNbr, void *cfgUsr);
int cStrCmdMgrDoCmd(cStrCmdMgrStc *scmPtr, const char *doName, void *cmdData);
int cStrCmdMgrPrtCmd(cStrCmdMgrStc *scmPtr);

#endif
